import { S } from '../../s';
import { IPSDEDQCondition } from './ipsdedqcondition';
import { IPSDEDQGroupCondition } from './ipsdedqgroup-condition';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEDQGroupConditionImpl
  extends PSModelObjectImpl
  implements IPSDEDQGroupCondition
{
  get condOp(): 'AND' | 'OR' {
    return this.M.condOp;
  }

  get condType(): 'GROUP' | 'SINGLE' | 'CUSTOM' | 'PREDEFINED' {
    return this.M.condType;
  }

  protected psdedqconditions: IPSDEDQCondition[];
  getPSDEDQConditions(): IPSDEDQCondition[] | null {
    return (
      this.psdedqconditions ||
      (this.psdedqconditions = this.fillChildListModel(
        this.M.getPSDEDQConditions,
        S._39d,
      ) as IPSDEDQCondition[])
    );
  }

  findPSDEDQCondition(objKey: any): IPSDEDQCondition | null {
    return this.getPSModel5(
      S._39d,
      this.getPSDEDQConditions(),
      objKey,
    ) as IPSDEDQCondition;
  }

  get notMode(): boolean {
    return this.M.notMode != null ? this.M.notMode : false;
  }
  get cls(): string {
    return 'PSDEDQGroupConditionImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3a2) return true;
    return super.instanceof(cls);
  }
}
